﻿using Basic.OARemoteModel.DataFillIn;
using Basic.OARemoteModel.DataFillIn.Model;
using Basic.OAService.Interface;
using WeDonekRpc.Client;
using WeDonekRpc.Client.Interface;

namespace Basic.OAService.RpcEvent
{
    internal class DataFillInEvent : IRpcApiService
    {
        private readonly IDataFillInService _Service;

        public DataFillInEvent ( IDataFillInService service )
        {
            this._Service = service;
        }

        public long AddFillIn ( AddFillIn data )
        {
            return this._Service.Add(data.Datum);
        }

        public void DeleteFillIn ( DeleteFillIn obj )
        {
            this._Service.Delete(obj.Id);
        }

        public FillInData GetFillIn ( GetFillIn obj )
        {
            return this._Service.Get(obj.Id);
        }

        public PagingResult<FillInDatum> QueryFillIn ( QueryFillIn obj )
        {
            return this._Service.Query(obj.Query, obj.ToBasicPage());
        }

        public bool SetFillIn ( SetFillIn obj )
        {
            return this._Service.Set(obj.Id, obj.Datum);
        }

        public bool StopFillIn ( StopFillIn obj )
        {
            return this._Service.Stop(obj.Id);
        }
    }
}
